home *** CD-ROM | disk | FTP | other *** search
- /* Copyright 1994-1995 H.Ogasawara(COR.) */
-
- #include <sys_doslib.h>
- #include <corlib.h>
-
- #define GH 512
- #define GV 512
-
- #define DEBUG 0
-
- GposSetOffset( x, y, h, v )
- {
- int ax, ay;
- if( WindowGetGraphicMode() != WindowAttrGraphic16 ){
- int nx, ny;
- WindowGetGraphicOffset( &ax, &ay );
- #if DEBUG
- {
- char b[30];
- s_format(b,"GposGetOffset %d,%d\r\n", ax, ay );
- PRINT( b );
- }
- #endif
- if( ax > x ){
- nx= x;
- }else if( ax+GH < x+h ){
- nx= x+h-GH;
- }else
- nx= ax;
- if( ay > y ){
- ny= y;
- }else if( ay+GV < y+v ){
- ny= y+v-GV;
- }else
- ny= ay;
- if( nx < 0 )
- nx= 0;
- if( ny < 0 )
- ny= 0;
- if( nx >= GH )
- nx= GH;
- if( ny >= GV )
- ny= GV;
- #if DEBUG
- {
- char b[30];
- s_format(b,"GposSetOf %d,%d\r\n", nx, ny );
- PRINT( b );
- }
- #endif
- if( ax != nx || ay != ny )
- return WindowSetGraphicOffset( nx, ny,
- OffsetDefaultLevel );
- }
- return FALSE;
- }
-
-